﻿#include "user.h"

User::User(QObject *parent): QBaseEntity(parent)
{
    clear();
    const QMetaObject *metaObject = this->metaObject();
    setTableName(QString(metaObject->className()).toLower());
    setPrimaryKey("id");
    setUniqueKeys(QStringList() << "username");
    setNotNullKeys(QStringList() << "username" << "password" << "roles");
    setDefaultValue("roles",QStringList("guest"));  //默认身份-访客
    setDefaultValue("status",USER_STATUS_DISABLED); //默认状态禁用
}

User::~User()
{

}

uint64_t User::getId() const
{
    return id;
}

void User::setId(const uint64_t &value)
{
    id = value;
}

QString User::getPassword() const
{
    return password;
}

void User::setPassword(const QString &value)
{
    password = value;
}

QString User::getRealName() const
{
    return realName;
}

void User::setRealName(const QString &value)
{
    realName = value;
}

QString User::getUsername() const
{
    return username;
}

void User::setUsername(const QString &value)
{
    username = value;
}

QStringList User::getRoles() const
{
    return roles;
}

void User::setRoles(const QStringList &value)
{
    roles = value;
}

int User::getStatus() const
{
    return status;
}

void User::setStatus(int value)
{
    status = value;
}

uint64_t User::getDeptId() const
{
    return deptId;
}

void User::setDeptId(const uint64_t &value)
{
    deptId = value;
}

uint64_t User::getPostId() const
{
    return postId;
}

void User::setPostId(const uint64_t &value)
{
    postId = value;
}


QString User::getAvatar() const
{
    return avatar;
}

void User::setAvatar(const QString &value)
{
    avatar = value;
}

QString User::getRemark() const
{
    return remark;
}

void User::setRemark(const QString &value)
{
    remark = value;
}

QString User::getGender() const
{
    return gender;
}

void User::setGender(const QString &value)
{
    gender = value;
}
